package org.jeecg.modules.exPingbiao.service.impl;

import org.jeecg.modules.exPingbiao.entity.ExTbcompanyScore;
import org.jeecg.modules.exPingbiao.entity.ExZbcandidateDetailed;
import org.jeecg.modules.exPingbiao.mapper.ExTbcompanyScoreMapper;
import org.jeecg.modules.exPingbiao.service.IExTbcompanyScoreService;
import org.jeecg.modules.exPingbiao.service.IExZbcandidateDetailedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Date;

/**
 * @Description: 投标单位得分
 * @Author: jeecg-boot
 * @Date:   2024-11-27
 * @Version: V1.0
 */
@Service
public class ExTbcompanyScoreServiceImpl extends ServiceImpl<ExTbcompanyScoreMapper, ExTbcompanyScore> implements IExTbcompanyScoreService {

    @Autowired
    private IExZbcandidateDetailedService iExZbcandidateDetailedService;
    @Override
    public Boolean setCandidate(String id) {
        ExTbcompanyScore exTbcompanyScore = this.getById(id);
        ExZbcandidateDetailed exZbcandidateDetailed = new ExZbcandidateDetailed();
        exZbcandidateDetailed.setTenderListId(exTbcompanyScore.getTenderListId());
        exZbcandidateDetailed.setSectionid(exTbcompanyScore.getBidSectionId());
        exZbcandidateDetailed.setWinCandidateName(exTbcompanyScore.getBidderName());
        exZbcandidateDetailed.setCreateTime(new Date());
        return iExZbcandidateDetailedService.save(exZbcandidateDetailed);
    }
}
